<!doctype html>
<html>

<head>
	<meta charset="utf-8">
	<title>订单详情</title>
	<% include  ../template/commonCss.ejs %>
	<link href="<%=resUrl%>/css/order/detail.css" rel="stylesheet" type="text/css" />
	<% include ../template/commonJs.ejs %>
	<% include ../template/chatLister.ejs %>
</head>

<script>
	var myOrderId= '<%-orderId%>';
</script>
<body ontouchstart>
	<% var topTitle = '' ;var topReturnType = '';var returnUrl = '/order/sellerList?state=-1'%>
	<% include ../template/topReturn.ejs %>
	<div id="contentTo"></div>
	<script id="content" type="text/html">	
	<div class="odetail-top" <%if(locals.token && token != ''){%>style="margin-top:0;"<%}%> >
			{{if  state == 0}}
			<div class="odetail-order-state">待付款</div>
			{{else if  state == 10}} 
			<div class="odetail-order-state">待发货</div>
			{{else if  state == 20}}
			<div class="odetail-order-state">
				待收货
				{{if  reveiveGoodsEndDate}}
				<div style="font-size:0.26rem;margin-top:0.1rem">还剩<time sign="unmake" time="{{reveiveGoodsEndDate | CountdownTime}}"></time>自动确认</div>
				{{/if}}
			</div>
			{{else if  state == 30}}
			<div class="odetail-order-state">待评价</div>
			{{else if  state == 31}}
			<div class="odetail-order-state">申请退款中</div>
			{{else if  state == 32}}
			<div class="odetail-order-state">退款中</div>
			{{else if  state == 33}}
			<div class="odetail-order-state">拒绝退款</div>
			{{else if  state == 34}}<!--已退款-->
			<div class="odetail-order-state">交易关闭</div>
			{{else if  state == 40}}
			<div class="odetail-order-state">交易完成</div>
			{{else if  state == 99}}
			<div class="odetail-order-state">交易关闭</div>
			{{/if}}
		
		<div class="odetail-logo"></div>
	</div>
	
	{{if (receiveDetail)}}
	{{if (receiveDetail.logisticsCompany)}}
	<div class="odetail-express" onclick="logisticeDetail();">
		<div class="odetail-express-logo"></div>
		<div class="odetail-express-rig">
			<div class="odetail-express-desc"  id="odetailExpressDesc">{{receiveDetail.logisticsCompany}}{{receiveDetail.logisticsNo}}</div>
			<div class="oderail-express-time" id="oderailExpressTime">暂无物流信息</div>
		</div>
		<div class="oderail-express-next"></div>
		<div class="auto-height"></div>
	</div>
	{{/if}}	
	<div class="odetail-adree">
		<div class="odetail-adree-logo"></div>
		<div class="odetail-adree-rig">
			<div class="oderail-adree-time"><span>{{receiveDetail.userName}}</span>{{receiveDetail.userPhone}}</div>
			<div class="odetail-adree-desc">{{receiveDetail.areaNames}} {{receiveDetail.address}}</div>
		</div>
		<div class="auto-height"></div>
	</div>
	{{/if}}
	<div class="shoplist-item">
		<div class="shoplist-item-top">	
			<img class="shoplist-item-logo" src="{{userDetail.photo}}">
			<span>{{userDetail.name}}
		</div>
		<div class="shoplist-item-body">
			<a class="info" {{if productDetail.type==1}} href="javascript:visitUrl('/auctionCollectDetail?id={{productDetail.id}}',true)" {{else}} href="javascript:visitUrl('/collectDetail?id={{productDetail.id}}',true)" {{/if}}>										
			<div class="order-body-let" style="width:1.68rem;height:1.68rem;background: url({{productDetail.coverImage}}?x-oss-process=image/resize,w_500) no-repeat 0 center;background-size: 100% auto;border:1px solid #DDDDDD;">
			</div>
			</a>	
			<div class="order-body-cen">
				<div class="order-pro-name">{{productDetail.name}}</div>
				<div class="auto-height"></div>
				{{if tradeType ==1}}
				<div class="order-img order-img-pai"></div>
				{{/if}}
				{{if productDetail.marginAuthentication == 1}}
				<div class="order-img order-img-bao"></div>
				{{/if}}
			</div>	
			<div class="order-body-rig">
				<div>￥{{productDetail.price}}</div>
				<div class="order-pro-number">x{{productDetail.count}}</div>
			</div>	
			<div class="auto-height"></div>
			<div class="order-bottom" >
					{{if state == 0}}
					<div class="order-bots order-bots-orange" onclick="upPrice('{{id}}',1);">修改价格</div>
					{{else if state == 10}}
					<!-- 待发货 -->
					{{else if state == 20}}
					<!-- 待收货 -->
					{{else if state == 30}}
					{{else if state == 31}}
					<!-- 申请退款（待确认） -->
					<a href="javascript:visitUrl('/order/refundDetail?id={{id}}&isSeller=true',true)">
						<div class="order-bots order-bots-orange" >退款详情</div>
					</a>
					<div class="order-bots order-bots-orange" onclick="opRefund('{{id}}',1);">确认退款</div>
					<div class="order-bots order-bots-orange" onclick="opRefund('{{id}}',2);">拒绝退款</div>
					{{else if state == 32}} <!-- 卖家同意退款 -->
					<div class="order-bots order-bots-orange" onclick="finishRefund('{{id}}');">完成退款</div>
					{{else if state == 33}}
					<!-- 买家退货（待收货） -->
					{{else if state == 34}}
					<!-- 卖家收货 -->
					{{else if state == 40}}
					<!-- 已评价 -->
					{{else if state == 99}}
					<!-- 交易关闭 -->
					{{/if}}
				
			</div>	
			<div class="order-bottom-item" >
				<div class="order-left" >藏品单价</div>
				<div class="order-rig" >￥{{productDetail.money}}</div>
			</div>
			<div class="order-bottom-item" >
				<div class="order-left" >快递费</div>
				<div class="order-rig" >￥{{logisticsFee || 0}}</div>
			</div>	
			<div class="order-bottom-item" >
				<div class="order-left" >订单总价</div>
				<div class="order-rig" >￥{{totalMoney || 0}}</div>
			</div>
			{{if createDate}}
			<div class="order-bottom-item" >
				<div class="order-left" >创建时间</div>
				<div class="order-rig" >{{createDate | TimestampToTime}}</div>
			</div>
			{{/if}}	
			{{if payDate}}
			<div class="order-bottom-item" >
				<div class="order-left" >支付时间</div>
				<div class="order-rig" >{{payDate | TimestampToTime}}</div>
			</div>
			{{/if}}	
			{{if completeDate && state == 40}}
			<div class="order-bottom-item" >
				<div class="order-left" >完成时间</div>
				<div class="order-rig" >{{completeDate  | TimestampToTime}}</div>
			</div>
			{{/if}}	
			{{if refundDetail && refundDetail.date }}
			<div class="order-bottom-item" >
				<div class="order-left" >退款时间</div>
				<div class="order-rig" >{{refundDetail.date | TimestampToTime}}</div>
			</div>
			{{/if}}	
			{{if state == 99 }}
			<div class="order-bottom-item" >
				<div class="order-left" >关闭原因</div>
				<div class="order-rig" >买家未付款</div>
			</div>
			{{/if}}	
			{{if state == 34 }}
			<div class="order-bottom-item" >
				<div class="order-left" >关闭原因</div>
				<div class="order-rig" >买家退款</div>
			</div>
			{{/if}}	
		</div>
	</div>
	{{if state != 99 }}
	<div class="order-bottom-all" >
		<div class="order-left" >实付款</div>
		<div class="order-rig" >￥{{payMoney || 0}}</div>
	</div>	
	{{/if}}		
	 
	</script>
	<div id="select_logistics_detail" class='weui-popup__container' >
		<div class="weui-popup__overlay"></div>
		<div class="weui-popup__modal" >
			<div style="text-align:center;line-height:1rem;margin-top: 0.5rem;" id="logisCpmName"></div>
			<div id="contentLogisticsTo"></div>
			<div class="weui-cell">
				<a href="javascript:;" class="weui-btn weui-btn_primary close-popup" onclick="showTop();">关闭</a>
			</div>
			
		</div>
	</div>
	<script id="contentLogistics" type="text/html">
		
		<div style="text-align:center;margin-bottom:0.5rem">单号{{LogisticCode}}</div>
		{{each Traces}}	
		<div class="odetail-express">
			<div class="odetail-express-logo"></div>
			<div class="odetail-express-rig">
				
				<div class="odetail-express-desc">{{$value.AcceptStation}}</div>
				<div class="oderail-express-time">{{$value.AcceptTime}}</div>
			</div>
			<div class="auto-height"></div>
		</div>
		{{/each}}
	</script>
	
	<script type="text/javascript" src="<%=resUrl%>/js/order/sellerDetail.js"></script>
</body>

</html>